Skip to content

Conversation

sah0725
Copy link
Contributor

@sah0725 sah0725 commented Oct 7, 2025

Closes #13159

Summary

This PR adds comprehensive documentation for floating point precision issues in CSV operations, addressing the documentation gap identified in issue #13159.

Changes

  • Added new section "Floating Point Precision in CSV" to doc/source/user_guide/io.rst
  • Includes explanation of why precision loss occurs during CSV roundtrips
  • Documents proper usage of float_format parameter with practical examples
  • Provides format specifier reference (%.6f, %.10g, %.6e, etc.)
  • Includes best practices for different data types (scientific, financial, high-precision)
  • Adds testing function for users to validate their precision needs
  • Covers dtype preservation behavior after CSV roundtrips

Examples Added

  • 6 working code examples with proper cleanup
  • Interactive ipython blocks for documentation building
  • Real-world scenarios demonstrating precision issues and solutions

Validation

  • All code examples tested and verified to work correctly
  • Proper reStructuredText formatting confirmed
  • Addresses all requirements mentioned in the original issue

sah0725 and others added 9 commits October 7, 2025 23:37
… operations

Addresses issue pandas-dev#13159 by adding detailed documentation about:
- Why floating point precision loss occurs in CSV roundtrips
- How to use float_format parameter to control precision
- Format specifier reference (%.6f, %.10g, %.6e, etc.)
- Best practices for different data types (scientific, financial)
- Testing function to validate roundtrip precision
- dtype preservation behavior

Includes 6 working code examples with proper cleanup and
comprehensive guidance for users experiencing CSV precision issues.
Removes trailing spaces that were causing pre-commit checks to fail.
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears this issue was already claimed in #13159 (comment). Additionally, I suspect this PR was heavily AI generated which we disallow. So closing

@mroeschke mroeschke closed this Oct 8, 2025
@sah0725
Copy link
Contributor Author

sah0725 commented Oct 10, 2025

Thanks for the pull request, but it appears this issue was already claimed in #13159 (comment). Additionally, I suspect this PR was heavily AI generated which we disallow. So closing

Thanks for the review. I understand and respect the policy on AI‑generated content and the note that this issue was already claimed. I’ll close out on my side and look for an unclaimed docs issue to tackle with a smaller, reviewer‑driven patch. Appreciate the guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: floating point precision on writing/reading to csv

2 participants